package com.feinno.urcs.group.entity;

import com.feinno.superpojo.SuperPojo;
import com.feinno.superpojo.annotation.Childs;
import com.feinno.superpojo.annotation.Entity;
import com.feinno.superpojo.annotation.Field;
import com.feinno.superpojo.annotation.NodeType;

import java.util.List;

/**
 * Created by honghao on 4/28/15.
 */
@Entity(name = "conference-info", standalone = false)
public class GroupListNotifyInfo extends SuperPojo {
	@Field(id = 1, name = "xmlns", type = NodeType.ATTR)
	private String xmlns = "urn:ietf:params:xml:ns:conference-info";

	@Field(id = 2, name = "entity", type = NodeType.ATTR)
	private String entity;

	@Field(id = 3, name = "state", type = NodeType.ATTR)
	private String state = "list";

	@Field(id = 4, name = "conference-list")
	private ConferenceList conferenceList;

	public ConferenceList getConferenceList() {
		return conferenceList;
	}

	public void setConferenceList(ConferenceList conferenceList) {
		this.conferenceList = conferenceList;
	}

	public String getEntity() {
		return entity;
	}

	public void setEntity(String entity) {
		this.entity = entity;
	}

	public String getXmlns() {
		return xmlns;
	}

	public void setXmlns(String xmlns) {
		this.xmlns = xmlns;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Entity(name = "conference-list")
	public static class ConferenceList extends SuperPojo {

		@Field(id = 1, name = "grouplist-ver")
		private GroupListVer groupListVer;

		@Childs(id = 2, parent = "grouplist", child = "group-info")
		private List<GroupListInfo> grouplistInfos;

		public GroupListVer getGroupListVer() {
			return groupListVer;
		}

		public void setGroupListVer(GroupListVer groupListVer) {
			this.groupListVer = groupListVer;
		}

		public List<GroupListInfo> getGrouplistInfos() {
			return grouplistInfos;
		}

		public void setGrouplistInfos(List<GroupListInfo> grouplistInfos) {
			this.grouplistInfos = grouplistInfos;
		}
	}

	public static class GroupListVer extends SuperPojo {
		@Field(id = 1, type = NodeType.ATTR)
		private String version;

		public String getVersion() {
			return version;
		}

		public void setVersion(String version) {
			this.version = version;
		}
	}

	public static class GroupListInfo extends SuperPojo {
		@Field(id = 1, type = NodeType.ATTR)
		private String entity;
		@Field(id = 2, type = NodeType.NODE)
		private String conversationid;
		@Field(id = 3, type = NodeType.NODE)
		private String name;

		public String getEntity() {
			return entity;
		}

		public void setEntity(String entity) {
			this.entity = entity;
		}

		public String getConversationid() {
			return conversationid;
		}

		public void setConversationid(String conversationid) {
			this.conversationid = conversationid;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}
	}
}
